package com.youlu.campus.admin.community.controller;

import com.youlu.campus.admin.community.dto.CommentQueryRequest;
import com.youlu.campus.admin.community.dto.CommentResponse;
import com.youlu.campus.admin.community.dto.CommentUpdateRequest;
import com.youlu.campus.admin.community.service.CommentService;
import com.yuelin.infrastructure.quantum.common.QResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

/**
 * 评论管理控制层
 * @author: YangJ
 * @date: 2020/12/11 14:09
 */
@RestController
public class CommentController {

    @Autowired
    private CommentService commentService;

    /**
     * 评论列表
     * @param request
     * @return
     */
    @PostMapping("/comment/list")
    public QResult commentList(@RequestBody CommentQueryRequest request){

        return QResult.success(commentService.commentList(request));
    }

    /**
     * 修改评论信息
     * @param request
     * @return
     */
    @PostMapping("/comment/update")
    public QResult updateComment(@RequestBody CommentUpdateRequest request){

        return QResult.success(commentService.updateComment(request));
    }
}
